/*
 * Copyright (c) 2025 STMROS Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef STMCONN_STMCONN_MOCK_HPP_
#define STMCONN_STMCONN_MOCK_HPP_

#include "stmconn/stmconn_interface.hpp"
#include <thread>
#include <mutex>

namespace stmconn {

class StmConnMock : public StmConnInterface {
public:
  StmConnMock();
  ~StmConnMock() override;
  
  bool open() override;
  void close() override;
  bool is_open() const override;
  bool send_message(const StmLinkMessage & msg) override;
  
private:
  void mock_data_thread_func();
  
  std::thread mock_thread_;
  std::mutex mutex_;
  bool stop_threads_;
  bool connected_;
};

} // namespace stmconn

#endif // STMCONN_STMCONN_MOCK_HPP_